// 使用 redis 数据库
import redis from "redis";
import RedisStore from "connect-redis";

const redisClient = redis.createClient({
  host: process.env.REDIS_HOST || "localhost",
  port: process.env.REDIS_PORT || 6379,
});
redisClient
  .connect()
  .then(() => {
    console.log("Redis connected");
  })
  .catch(console.error);

export const redisStore = new RedisStore({ client: redisClient });
